package com.zheng.russiaRec.controller 
{
	import com.zheng.russiaRec.model.P_Checkerboard;
	import com.zheng.russiaRec.staticData.EventData;
	
	import flash.ui.Keyboard;
	
	import org.puremvc.as3.interfaces.INotification;
	
	/**
	 * @describe  	旋转积木
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		... 
	 */
	public class C_RotationGroup extends C_BaseCommand
	{	
		/* INTERFACE org.puremvc.as3.interfaces.ICommand */
		
		override public function execute(notification:INotification):void 
		{
			var userOP:int = notification.getBody().userOP;
			var temp:Array=[];
			var moveStatus:int;
			if (userOP == Keyboard.UP) {
				temp=p_cb.rotationGroup();
				p_cb.setLgDirBack();
				moveStatus=p_cb.getTargetStatus(temp);
				p_cb.dealMoveStatus(temp,moveStatus);
				//不能正常到达目标rec
				if(moveStatus==P_Checkerboard.CAN_MOVE_TO){
					sendNotification(EventData.P_GROUP_UPDATE);
					p_cb.setLgDirNext();
				}
			}
		}
		
	}
	
}